//
//  NeedPurTableViewCell.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/12.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "NeedPurTableViewCell.h"

@implementation NeedPurTableViewCell{
    GLGWImageView * leftImageView;
    GLGWLabel * purTitleLabel;
    GLGWLabel * describeLabel;
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        leftImageView = [[GLGWImageView alloc] initWithFrame:CGRectMake(kWidthProportion_In_iPhoneTriploid(15), kHeightProportion_In_iPhoneTriploid(30), kWidthProportion_In_iPhoneTriploid(30), kHeightProportion_In_iPhoneTriploid(30)) inSuperView:self];
//        leftImageView.backgroundColor = kRandomColor;
        //
        purTitleLabel = [[GLGWLabel alloc] initWithFrame:CGRectMake(kX_With_View(leftImageView, 30), kHeightProportion_In_iPhoneTriploid(22), 100, kHeightProportion_In_iPhoneTriploid(22)) theFont:SYSTEMFONT(16) theColor:kColor_Rule_Black inSuperView:self];
        //
        describeLabel = [[GLGWLabel alloc] initWithFrame:CGRectMake(purTitleLabel.x, kY_With_View(purTitleLabel, 5), KScreenWidth - purTitleLabel.x - kWidthProportion_In_iPhoneTriploid(45), kHeightProportion_In_iPhoneTriploid(20)) theFont:SYSTEMFONT(14) theColor:[UIColor colorWithHexString:@"#999999"] inSuperView:self];
        describeLabel.text = @"极速求购说明";
        //
        GLGWImageView * pushIamgeView = [[GLGWImageView alloc] initWithImageName:@"icon_chakangengduo" inSuperView:self];
//        pushIamgeView.backgroundColor = kRandomColor;
        [pushIamgeView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.mas_top).offset(kHeightProportion_In_iPhoneTriploid(38));
            make.right.equalTo(self.mas_right).offset(-kWidthProportion_In_iPhoneTriploid(15));
            make.width.equalTo(@(kWidthProportion_In_iPhoneTriploid(15)));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(15)));
        }];
        //
        GLGWView * bottomView = [[GLGWView alloc] initWithFrame:CGRectMake(0, kHeightProportion_In_iPhoneTriploid(90), KScreenWidth, kHeightProportion_In_iPhoneTriploid(10)) inSuperView:self];
        bottomView.backgroundColor = [UIColor colorWithHexString:@"#F2F2F2"];
    }
    return self;
}

-(void)setRowIndex:(NSIndexPath *)rowIndex{
    _rowIndex = rowIndex;
    switch (_rowIndex.row) {
        case 0:{
            purTitleLabel.text = @"普通求购";
            leftImageView.imageName = @"icon_putong";
        }
            break;
        case 1:{
            purTitleLabel.text = @"定金求购";
            leftImageView.imageName = @"icon_dingjin";
        }
            break;
        case 2:{
            purTitleLabel.text = @"长期求购";
            leftImageView.imageName = @"icon_changqi";
        }
            break;
        case 3:{
            purTitleLabel.text = @"图片求购";
            leftImageView.imageName = @"icon_tupian";
        }
            break;
        case 4:{
            purTitleLabel.text = @"委托求购";
            leftImageView.imageName = @"icon_weituo";
        }
            break;
            
        default:
            break;
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
